﻿@{
    SCS.Business.MembershipService _membershipServices = new SCS.Business.MembershipService();
    string userName = User.Identity.Name;
    var user = _membershipServices.GetUser(userName);
    if (user != null)
    {
        if (user.MembershipRoles.FirstOrDefault().roleID == 1)
        {
            Layout = "~/Views/Shared/_AdminLayout.cshtml";
        }
        else if (user.MembershipRoles.FirstOrDefault().roleID == 2)
        {
            Layout = "~/Views/Shared/_ParentsLayout.cshtml";
        }
        else
        {
            Layout = "~/Views/Shared/_TeacherLayout.cshtml";
        }
    }
    else
    {
        Layout = "~/Views/Shared/_AdminLayout.cshtml";
    }
}